<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="menu" content="assetMenu" />
<meta name="nav" content="1" />
<meta name="acc" content="0" />
<title>公告管理</title>
<script>
		$(document).ready(function() {
		 $("#addPublish").click(function(){
			 location.href="${ctx}/asset/message/publish!input.action";
		 });
		});
		
		function showFalse(event){
				var checkedBox = $("input:checked");
				var  publishsId = new String("")  ;
				$.each(checkedBox, function(){
					publishsId+=$(this).val()+"_";	 							
				});
				confirm("您本次将操作"+checkedBox.length+"条公告？");
				if(event.value=="显示"){
					location.href="${ctx}/asset/message/publish!publishShowFalse.action?showTag=0&publishsId="+publishsId;
				}else{
					location.href="${ctx}/asset/message/publish!publishShowFalse.action?showTag=1&publishsId="+publishsId;
				}
		}
			
	</script>
</head>
<body>
<form id="mainForm" action="publish.action" method="get" class="yform">
<h1>公告管理</h1>
<input type="hidden" name="page.pageNo" id="pageNo"
	value="${page.pageNo}" /> <input type="hidden" name="page.orderBy"
	id="orderBy" value="${page.orderBy}" /> <input type="hidden"
	name="page.order" id="order" value="${page.order}" />
<div id="message"><s:actionmessage theme="custom"
	cssClass="success" /></div>
<div id="filter">发布单位 ：<input type="text"
	name="filter_LIKES_bookType" value="${param['filter_LIKES_bookType']}" />
发布日期：<input type="text" name="filter_LIKES_bookName"
	value="${param['filter_LIKES_bookName']}" /> <br />
重要程度：<input type="text" name="filter_LIKES_edit"
	value="${param['filter_LIKES_edit']}" /> 标题：<input type="text"
	name="filter_LIKES_stored" value="${param['filter_LIKES_stored']}" /> <input
	type="button" value="查询" onclick="search();" /> <input type="button"
	id="addPublish" value="新增" /> <input type="button" value="显示"
	onclick="showFalse(this);" /> <input type="button" value="不显示"
	onclick="showFalse(this);" /></div>
<div id="content">
<table id="contentTable">
	<tr>
		<th>选择</th>
		<th>发布单位</th>
		<th>发布人</th>
		<th>重要程度</th>
		<th>公告类型</th>
		<th>标题</th>
		<th>发布日期</th>
		<th>操作</th>
	</tr>
	<c:forEach items="${page.result}" var="publish">
		<tr>
			<td><input type="checkbox" value="${publish.id}"></input></td>
			<td>${publish.department.depName}</td>
			<td>${publish.publishPerson.userName}</td>
			<td>${publish.importance}</td>
			<td>${publish.noticeType}</td>
			<td>${publish.title}</td>
			<td>${publish.createDate}</td>
			<td><a
				href="${ctx}/asset/message/publish!input.action?id=${publish.id}">编辑</a>
			<a href="${ctx}/asset/message/publish!delete.action?id=${publish.id}">删除</a>
			</td>
		</tr>
	</c:forEach>
</table>
</div>
<div id="pagebar">第${page.pageNo}页, 共${page.totalPages}页 <a
	href="javascript:jumpPage(1)">首页</a> <s:if test="page.hasPre">
	<a href="javascript:jumpPage(${page.prePage})">上一页</a>
</s:if> <s:if test="page.hasNext">
	<a href="javascript:jumpPage(${page.nextPage})">下一页</a>
</s:if> <a href="javascript:jumpPage(${page.totalPages})">末页</a></div>
</form>
</body>
</html>
